package Chapter06;

import java.util.Scanner;

public class Tourist {
    String name;
    int age;

    public void show(){
        Scanner input=new Scanner(System.in);
        while (!name.equals("n")){
            if(age>=14&&age<=65){
                System.out.println(name+"的年龄"+age+"门票20");
            }else if(age<14){
                System.out.println(name+"的年龄"+age+"门票免了");
            }
            System.out.println("请输入姓名：");
            name=input.next();
            if(!name.equals("n")){
                System.out.println("请输入年龄：");
                age=input.nextInt();
            }
        }
    }
}
